package com.kalvan.commons.db.system.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.kalvan.commons.constant.DictType;
import com.kalvan.web.excel.annotation.Dict;
import com.kalvan.web.excel.annotation.NumberConvert;
import com.kalvan.web.excel.annotation.ExtSuffix;
import com.kalvan.core.mybatis.annotation.ShardingUk;
import com.kalvan.sensitive.annotation.Desensitized;
import com.kalvan.sensitive.enums.SensitiveType;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 测试流水表实体
 * 表名 demo
 *
 * @author kalvan.tools:kalvan
 */
@Getter
@Setter
@Table(name = "demo")
public class Demo extends BaseRowModel implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 自增id
     */
    @Id
    @ShardingUk
    @Column(name = "id")
    private Long id;

    /**
     * 交易流水号
     */
    @ExcelProperty(value = "交易流水号")
    @Column(name = "trans_id")
    private String transId;

    /**
     * 交易类型
     */
    @ExcelProperty(value = "交易类型")
    @Dict(DictType.TRANS_TYPE)
    @Column(name = "trans_type")
    private Integer transType;

    /**
     * 订单日期
     */
    @ExcelProperty(value = "订单日期")
    @Column(name = "order_date")
    private Integer orderDate;

    /**
     * 订单说明
     */
    @ExcelProperty(value = "订单说明")
    @Column(name = "order_note")
    private String orderNote;

    /**
     * 订单金额
     */
    @ExcelProperty(value = "订单金额")
    @NumberConvert(value = 100)
    @Column(name = "order_amount")
    private Long orderAmount;

    /**
     * 手续费
     */
    @ExcelProperty(value = "手续费")
    @NumberConvert(value = 100)
    @Column(name = "order_fee")
    private Long orderFee;

    /**
     * 费率
     */
    @ExcelProperty(value = "费率")
    @ExtSuffix("%")
    @Column(name = "order_fee_rate")
    private Long orderFeeRate;

    /**
     * 通知地址
     */
    @ExcelProperty(value = "通知地址")
    @Column(name = "notify_url")
    private String notifyUrl;

    /**
     * 银行帐号
     */
    @Desensitized(type = SensitiveType.BANK_CARD)
    @ExcelProperty(value = "银行帐号")
    @Column(name = "bank_account_no")
    private String bankAccountNo;

    /**
     * 银行户名
     */
    @Desensitized(type = SensitiveType.CHINESE_NAME)
    @ExcelProperty(value = "银行户名")
    @Column(name = "bank_account_name")
    private String bankAccountName;

    /**
     * 客户手机
     */
    @Desensitized(type = SensitiveType.MOBILE_PHONE)
    @ExcelProperty(value = "客户手机")
    @Column(name = "mobile")
    private String mobile;

    /**
     * 证件号码
     */
    @Desensitized(type = SensitiveType.ID_CARD)
    @ExcelProperty(value = "证件号码")
    @Column(name = "certificate_no")
    private String certificateNo;

    /**
     * 交易状态
     */
    @ExcelProperty(value = "交易状态")
    @Dict(DictType.DEMO_STATE)
    @Column(name = "state")
    private Integer state;

    /**
     * 审核发起人
     */
    @ExcelProperty(value = "审核发起人")
    @Column(name = "audit_applicant")
    private String auditApplicant;

    /**
     * 审核状态
     */
    @ExcelProperty(value = "审核状态")
    @Dict(DictType.AUDIT_STATE)
    @Column(name = "audit_state")
    private Integer auditState;

    /**
     * 审核人
     */
    @ExcelProperty(value = "审核人")
    @Column(name = "audit_user")
    private String auditUser;

    /**
     * 待审信息
     */
    @Column(name = "audit_temp")
    private String auditTemp;

    /**
     * 审核备注
     */
    @ExcelProperty(value = "审核备注")
    @Column(name = "audit_remark")
    private String auditRemark;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @ExcelProperty(value = "更新时间")
    @Column(name = "update_time")
    private Date updateTime;

}
